package cn.sofwin.sb.di;

import cn.sofwin.sb.AppConfig;
import cn.sofwin.sb.controller.UserController;
import cn.sofwin.sb.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class AnnotationDemo {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        /*User user = context.getBean(User.class);
        System.out.println(user);
        Computer computer = context.getBean(Computer.class);
        System.out.println(computer);*/
        UserController userController = context.getBean(UserController.class);
        User user = userController.findUser(2);
        System.out.println(user);
    }
}
